1. Field of the Invention
The present invention generally relates to an object detection method and an apparatus thereof, and more particularly, to an object detection method and an apparatus thereof which instantly updates a background to detect an object.
2. Description of Related Art
The demand to security monitoring system has been increasing along with the increasing consciousness to community security. A video cassette recorder (VCR) is usually used in a conventional analog monitoring system for recording the monitored content. However, an event can only be tracked by manually reviewing the recorded content after the event has happened. Thereby, the conventional analog monitoring system consumes a lot of manpower and accordingly the reliability thereof is greatly reduced.
In recently years, the development of intelligent monitoring systems is facilitated by the advancement of digital and multimedia techniques. In an intelligent monitoring system, the behaviors of a monitored object are digitally analyzed, and a warning message is issued when the object behaves abnormally so that action can be taken correspondingly. For example, a monitoring system integrated with a human face recognition technique can effectively prevent the intrusion of any stranger and automate the access management. In such a monitoring system based on object behavior analysis, a meaningful foreground object has to be correctly detected in order to carry out subsequent analysis and recognition operations.
It is very important in an object detection technique to establish a background by using sufficient number of images. Generally speaking, a background establishing model serves a pixel which appears the most number of times at the same position in the previous P images as the pixel at the same position in a reference background through a highest redundancy ratio (HRR) algorithm. Thereafter, the reference background is deducted from an input image to obtain a foreground object.
In the background establishing model described above, the previous P images are re-selected after a specific period to generate a new reference background and update the background. FIG. 1 is a diagram of a conventional background updating method. Referring to FIG. 1, the image sequence 100 includes a plurality of images 101 taken at different time. A reference background is established by performing HRR statistical analysis on the P images 101 in the sub image sequence 110. Next, during a specific period, a foreground object in each of the images 101 in the sub image sequence 120 is respectively detected according to the same reference background. After this specific period, the background establishing model re-selects the P images 101 in the sub image sequence 130 to establish a new reference background. Obviously, the background establishing model cannot instantly update the background as the scene variations in these images 101.
After the reference background is obtained, the reference background is deducted from an input image to obtain a foreground object. However, in an actual application, natural light changes, flickering, and shadowing may cause the foreground object to be wrongly determined. Accordingly, a RGB color model is provided, wherein the luminance difference and chrominance difference between the reference background and an input image are analyzed so as to categorize pixels in the input image into the foreground object, the background, the shadow, or bright spots.
In the method described above, when the chrominance difference between pixels at the same position in the input image and the reference background is greater than a threshold TH1, it is determined that the pixel in the input image belongs to the foreground object. However, as to those pixels in the input image which belong to the foreground object but have lower luminance, the chrominance difference between such a pixel and the pixel at the same position in the reference background is usually very small (i.e., the chrominance difference is smaller than the threshold TH1), the pixel may be mistakenly determined as belonging to a shadow. Accordingly, in this method, a pixel in the input image is determined as belonging to a foreground object when the luminance difference between this pixel in the input image and the pixel at the same position in the reference background is smaller than a threshold TH2. In short, a pixel in the input image is determined as belonging to a foreground object when either one of foregoing conditions regarding the luminance difference or the chrominance difference is met.
However, in the method described above, those pixels in the input image which belong to the foreground object but have higher luminance may be mistakenly determined as belonging to the bright spots in some cases when the chrominance difference obtained is still smaller than the threshold TH1. Thus, the analysis and process of luminance and chrominance have to be stricter in order to detect a complete foreground object.